package com.cs307.redcross.client;

import java.io.Serializable;

import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.RootPanel;

public class SubheaderPanel extends Composite implements Serializable {
	private static final long serialVersionUID = -2982000516973639334L;
	private RootPanel rootPanel;
	
	private static SubheaderPanel instance;
	public static SubheaderPanel getInstance() {
		if (instance == null)
			instance = new SubheaderPanel();
		
		return instance;
	}
	
	private SubheaderPanel() {
		rootPanel = RootPanel.get("subheader");
	}
	
	public void setSubheader(Subheader subheader) {
		//TODO: write code that will handle any changing of contents
		rootPanel.clear();
		rootPanel.add(subheader);
	}
	
	public void clearSubheader() {
		rootPanel.clear();
	}
	
}
